package edu.sctu.zcy.month201505.day20150528;

/**
 * Created by user24 on 2015/5/28.
 */
public class StringDemo {


    public static void main(String[] args) {

        TextString textString = new TextString();

        String string = " zcyc ";
        System.out.println("字符串相等："+textString.equalsDemo(string)+"\n字符串不等："+textString.equalsDemo("zc"));
        System.out.println("字符串长度："+textString.lengthDemo(string));
        System.out.println("截取0-2的子字符串"+textString.subStringDemo(string));
        System.out.println("取得字符串2位置的字符："+textString.charAtDemo(string));
        System.out.println("获取字符‘c’在字符串第一次出现的位置:"+textString.indexOfDemo(string));
        System.out.println("获取字符‘c’在字符串最后一次出现的位置:"+textString.lastIndexOfDemo(string));
        System.out.println("将字符串中的‘c’替换为‘w’:"+textString.replaceDemo(string));
        System.out.println("将字符串转换为大写："+textString.toLowerCaseDemo(string));
        System.out.println("将3转换为字符串："+textString.valueOfDemo(string));
        System.out.println("去掉字符串最前和最后的空格："+textString.trimDemo(string));
    }

}
